<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
>
<head th:replace="~{fragments/header :: header ('福利球-磁力搜索-列表-' + ${metadataPageVO.keyword})}">

</head>
<link href="../static/css/bootstrap-select.min.css" th:href="@{/css/bootstrap-select.min.css}" rel="stylesheet">
<body>
<div class="container">

    <div class="container text-center">
        <div th:replace="~{fragments/common :: searchInput(false)}"></div>

        <input type="checkbox" id="isMustContain" hidden th:checked="${orderVO.isMustContain}">
        <select id="orderType" class="selectpicker">
            <option th:selected="${orderVO.orderType == 0}" value="0">默认</option>
            <option th:selected="${orderVO.orderType == 1}" value="1">相关性</option>
            <option th:selected="${orderVO.orderType == 2}" value="2">热度</option>
            <option th:selected="${orderVO.orderType == 3}" value="3">大小</option>
            <option th:selected="${orderVO.orderType == 4}" value="4">最近</option>
        </select>
    </div>


    <div class="list-group content-top">
        <div th:if="${#lists.isEmpty(metadataPageVO.list)}" class="alert alert-success">抱歉,暂无此相关资源.</div>
        <div class="container">
            <div class="panel panel-info" th:each="metadataVO : ${metadataPageVO.list}"
                 th:object="${metadataVO.metadata}">
                <div class="panel-heading text-justify line-break">
                    <a th:href="'/detail/' + *{_id}" target="_blank">
                        <h3 class="panel-title " th:text="*{name}"></h3>
                    </a>
                </div>

                <div class="panel-body">
                    <div class="col-lg-3  col-sm-3 col-md-3 col-xs-12">
                        长度: <span th:text="${metadataVO.length}"></span>
                    </div>
                    <div class="col-lg-3  col-sm-3 col-md-3 col-xs-12">
                        <span class="glyphicon glyphicon-fire">热度</span>: <span th:text="*{hot}"></span>
                    </div>
                    <div class="col-lg-4  col-sm-4 col-md-4 col-xs-12">
                        创建时间: <span th:text="*{#dates.format(createTime,'yyyy-MM-dd HH:mm:ss')}"></span>
                    </div>
                    <div class="col-lg-2  col-sm-2 col-md-2 col-xs-12">
                        <a th:onclick="*{'list.clickCopy(this,&quot;'+_id+'&quot;,&quot;' +'magnet:?xt=urn:btih:' + infoHash + '&quot;)'}">点击复制</a>
                    </div>

                </div>
            </div>
        </div>

    </div>
</div>

<div class="container text-center">
    <ul class="pagination pagination-lg">
        <li th:class="${metadataPageVO.pageNo == 1 || metadataPageVO.pageNo <=5}   ? 'hidden'">
            <a href="javascript:void(0);" th:onclick="${'common.listByKeyword(1,&quot;'+ metadataPageVO.keyword +'&quot;)'}" aria-label="Previous">
                <span aria-hidden="true">«</span>
            </a>
        </li>

        <li th:each="i : ${#numbers.sequence(metadataPageVO.pageNo <= 5 ? 1 : metadataPageVO.pageNo - 4 ,
        metadataPageVO.totalPage <= 10 ? metadataPageVO.totalPage
        : (metadataPageVO.pageNo + 4 <=  metadataPageVO.totalPage) ? metadataPageVO.pageNo + 4
        : metadataPageVO.totalPage)}"

            th:class="${metadataPageVO.pageNo == i} ? 'active'">
            <a href="javascript:void(0);" th:onclick="${'common.listByKeyword(this.text,&quot;'+ metadataPageVO.keyword +'&quot;)'}"  th:text="${i}"></a>
        </li>

        <li th:class="${metadataPageVO.pageNo == metadataPageVO.totalPage || metadataPageVO.pageNo >= metadataPageVO.totalPage - 4} ? 'hidden'">
            <a th:data="${metadataPageVO.totalPage}" href="javascript:void(0);"
               th:onclick="${'common.listByKeyword(this.getAttribute(&quot;data&quot;),&quot;'+ metadataPageVO.keyword +'&quot;)'}"
                aria-label="Next">
                <span aria-hidden="true">»</span>
            </a>
        </li>
    </ul>
</div>


<span th:include="~{fragments/common :: js}"></span>
<script src="../static/js/customer/list.js" th:src="@{/js/customer/list.js}"></script>
<script src="../static/js/bootstrap-select.min.js" th:src="@{/js/bootstrap-select.min.js}"></script>
<script th:replace="~{fragments/common :: baiduAutoPush}"></script>
</body>
</html>

